VERSION=0.0.1
NAME=kingbase_exporter

.PHONY:build
build:
	go build -ldflags "-X main.Version=${VERSION}" -o ./bin/ .

.PHONY:build-windows
build-windows:
	GOOS=windows GOARCH=amd64 go build -ldflags "-X main.Version=${VERSION}" -o ./bin/${NAME}.exe .

.PHONY:build-linux
build-linux:
	GOOS=linux GOARCH=amd64 go build -ldflags "-X main.Version=${VERSION}" -o ./bin/${NAME} .

.PHONY:clean
clean:
	rm -r bin

.PHONY:run
run:
	go run .

.PHONY:test
test:
	go test -v ./...
